package com.chenhao.generator.constant;

import com.google.common.collect.ImmutableMap;

/**
 * 常量
 *
 * @author:chenHao
 * @version:1.0
 * @since:1.0
 * @createTime:2019-10-02
 */
public class Constant {

    private Constant() {

    }


    /**
     * 数据库数据类型对应java数据类型
     */
    public static final ImmutableMap<String, String> DATA_TYPE_MAP = ImmutableMap.<String, String>builder()
            .put("CHAR", "String")
            .put("VARCHAR", "String")
            .put("VARCHAR2", "String")
            .put("NVARCHAR2", "String")
            .put("TEXT", "String")
            .put("CLOB", "String")
            .put("LONG", "String")
            .put("INTEGER", "Integer")
            .put("TINYINT", "Integer")
            .put("SMALLINT", "Integer")
            .put("BIT", "Integer")
            .put("BIGINT", "Long")
            .put("FLOAT", "Double")
            .put("NUMBER", "BigDecimal")
            .put("DECIMAL", "BigDecimal")
            .put("TIMESTAMP", "Timestamp")
            .put("DATETIME", "LocalDateTime")
            .put("TIME", "LocalTime")
            .put("DATE", "LocalDate")
            .put("INT","Integer")
            .build();

    /**
     * 数据类型需要导入的包
     */
    public static final ImmutableMap<String, String> IMPORT_PACKAGE_MAP = ImmutableMap.<String, String>builder()
            .put("BigDecimal", "java.math.BigDecimal")
            .put("Date", "java.util.Date")
            .put("Timestamp", "java.sql.Timestamp")
            .put("LocalDateTime","java.time.LocalDateTime")
            .put("LocalDate","java.time.LocalDate")
            .put("LocalTime","java.time.LocalTime")
            .build();
}
